package tyk;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import tyk.autowired.People;
import tyk.autowired.controller.UserController;

/**
 * Hello world!
 *
 */
public class Main
{
    public static void main( String[] args )
    {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
        context.registerShutdownHook();
        Student student1 = context.getBean(Student.class);
//        Student student2 = context.getBean(Student.class);
//        System.out.println(student1);
//        System.out.println(student2);
        System.out.println("6.student对象可以用了");
        System.out.println("-------自动装配----------");
        People people = context.getBean(People.class);
        System.out.println(people);
        System.out.println("---------自动装配案例2--------");
        UserController userController = context.getBean(UserController.class);
        userController.search();
    }
}
